package cn.xiongxf.controller;

import cn.xiongxf.User;
import cn.xiongxf.feignclient.UserFeignClientFallbackFactory;
import cn.xiongxf.feignclient.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private UserService userService;

    /**
     * 接口：调用user接口
     * @return
     */
    @GetMapping("getById/{id}")
    public User getById(@PathVariable Long id){
        // 调用OpenFeign接口UserService，调用User服务
        return userService.getById(id);
    }

}
